<?php
namespace App\Models\Scripts;

use Illuminate\Support\Facades\DB;

class va60adb8db73e4a554d865bcb160bbe18 extends Sysupdate
{
    protected $version_id ='deloptions';

    private $returnData = array('code'=>0,'message'=>'执行成功');

    public function upgrade()
    {
        $this->_step_1();
        $this->_step_2();
        return $this->returnData;
    }

    /* 删除admin_users里的来源字段和项目字段 */
    private function _step_1()
    {
        $sql = "alter table admin_users drop column tx_project,drop column source_id;";
        DB::statement($sql);
        return $this->returnData;
    }

    /* 修改goods(商品)表里的权重字段类型和长度 */
    private function _step_2()
    {
        $sql = "alter table goods modify column goods_top smallint(5);";
        DB::statement($sql);
        return $this->returnData;
    }
}